import router from '@system.router';

export default {

    data() {
        return{
            title: 'World',

            src:"",
            routenum:'',
//            judgeea:1
        }
    },

    cameraError(){

    },

//    点击拍照加载拍照函数
    takePhoto(){


        var _this=this;

        console.log('------------------------------>takePhoto')

        var camera = this.$element('camera-id')

        if(this.routenum==1){
//            router.push({
//                uri:'pages/homepage/housedestroy/housedestroy',
//            })
            router.push({
                uri: 'pages/homepage/housedestroy/housedestroy',
                params: {
                    judgeea:0,
                },
                }
            );
            this.$app.$def.globalData.judgee=0;
        }

        if(this.routenum==2){
            router.push({
                uri:'pages/homepage/trafficdestroy/trafficdestroy',
            })
            this.$app.$def.globalData.judgee=0;
        }

//        router.back();
        camera.takePhoto({

            quality:'high',

            success(result){

                console.log(result);

                _this. src=result.uri;

                console.log("拍照成功路径==>>"+_this.src);

                //

            },

            fail(result){

                console.info('-------------fail------'+result)

            },

            complete(result){

                //                console.info('-------------complete------'+result)
            }

        })

    },



}